package com.goldgov.code.service;

import java.util.Date;

public class Log {
	
	public static final String LOG_TYPE_ADD_MODULE = "ADD_MODULE";
	public static final String LOG_TYPE_REMOVE_MODULE = "REMOVE_MODULE";
	public static final String LOG_TYPE_USER_LOGIN = "USER_LOGIN";
	public static final String LOG_TYPE_IMPORT_MODULE_BY_SQL  = "IMPORT_MODULE_BY_SQL";
	public static final String LOG_TYPE_IMPORT_MODULE_BY_JDBC  = "IMPORT_MODULE_BY_JDBC";
	public static final String LOG_TYPE_IMPORT_MODULE_BY_FILE  = "IMPORT_MODULE_BY_FILE";
	public static final String LOG_TYPE_UPDATE  = "UPDATE";
	public static final String LOG_TYPE_LOGIN = "USER_LOGIN";
	
	public static final String LOG_TYPE_CODE_EXPORT  = "CODE_EXPORT";
	public static final String LOG_TYPE_CONFIG_EXPORT_K8S_STANDARD  = "CONFIG_EXPORT_K8S_STANDARD";
	
	public static final String LOG_TYPE_PROJECT_EXPORT  = "LOG_TYPE_PROJECT_EXPORT";

	private String logID;
	private String projectID;
	private String logContent;
	private String logType;
	private Date createDate;
	private String userID;
	private String userName;
	
	public Log() {}
	
	public Log(String logType) {
		this.logType = logType;
	}
	
	public Log(String logType,String logContent,User user) {
		this.logType = logType;
		this.logContent = logContent;
		setUser(user);
	}
	
	public String getLogID() {
		return logID;
	}
	public void setLogID(String logID) {
		this.logID = logID;
	}
	public Date getCreateDate() {
		if(createDate == null) {
			createDate = new Date();
		}
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
	public void setUser(User user) {
		this.userID = user.getUserID();
		this.userName = user.getName();
	}
	public String getUserID() {
		return userID;
	}
	public void setUserID(String userID) {
		this.userID = userID;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getLogContent() {
		return logContent;
	}
	public void setLogContent(String logContent) {
		this.logContent = logContent;
	}
	public String getLogType() {
		return logType;
	}
	public void setLogType(String logType) {
		this.logType = logType;
	}

	public String getProjectID() {
		return projectID;
	}

	public void setProjectID(String projectID) {
		this.projectID = projectID;
	}
	
}
